package com.example.dto;

/**
 * <p>图片返回值</p>
 * FileResultEnum.SUCESS.result(1, "图片为空");
 * Created by zhezhiyong@163.com on 2018/7/24.
 */
public enum FileResultEnum {

    SUCESS {
        @Override
        public FileResult result(int code, String data) {
            FileResult result = new FileResult();
            result.setError(code);
            result.setUrl(data);
            return result;
        }
    },
    FAIL {
        @Override
        public FileResult result(int code, String data) {
            FileResult result = new FileResult();
            result.setError(code);
            result.setMessage(data);
            return result;
        }
    };

    public abstract FileResult result(int code, String data);

}
